package com.inspur.cloud.entity.dataspace.special;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.List;

public class RangerResource {
    String key;
    String isExcludes;
    String isRecursive;
    List<String> values;

    public RangerResource() {
        isExcludes = "false";
        isRecursive = "false";
        values = new ArrayList<String>();
    }

    public JSONObject toJsonObj() {
        JSONObject obj = new JSONObject();
        obj.put("isExcludes", isExcludes);
        obj.put("isRecursive", isRecursive);
        JSONArray array = new JSONArray();
        for (String v : values) {
            array.add(v);
        }
        obj.put("values", array);
        return obj;
    }


    public void addValue(String value) {
        values.add(value);
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getIsExcludes() {
        return isExcludes;
    }

    public void setIsExcludes(String isExcludes) {
        this.isExcludes = isExcludes;
    }

    public String getIsRecursive() {
        return isRecursive;
    }

    public void setIsRecursive(String isRecursive) {
        this.isRecursive = isRecursive;
    }


}
